import { $delete, $get, $post, $put } from './http'

// 获取分类参数
export const getCateParamsReq = (id, params) =>
  $get(`/categories/${id}/attributes`, params)

// 添加或编辑参数（动静）
export const addOrEditParamsReq = (id, params, attrId) =>
  attrId
    ? $put(`/categories/${id}/attributes/${attrId}`, params)
    : $post(`/categories/${id}/attributes`, params)

// 删除参数
export const deleteParamsReq = (id, attrid) =>
  $delete(`/categories/${id}/attributes/${attrid}`)

// 根据参数id查询参数值
export const queryParamsValReq = (id, attrId, params) =>
  $get(`/categories/${id}/attributes/${attrId}`, params)
